<html>
<head><meta charset="utf-8"><title>const generics in `infer` #59008 · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html">const generics in `infer` #59008</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="163579304"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163579304" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163579304">(Apr 17 2019 at 16:50)</a>:</h4>
<p>Hey <span class="user-mention" data-user-id="121053">@varkor</span> (not sure what yodaldevoid's Zulip name is),</p>
<p>I'm reviewing <a href="https://github.com/rust-lang/rust/issues/59008" target="_blank" title="https://github.com/rust-lang/rust/issues/59008">#59008</a> and I have a few questions. To start, what is the story with <code>LazyConst</code>?</p>



<a name="163579336"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163579336" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163579336">(Apr 17 2019 at 16:50)</a>:</h4>
<p>i.e., initially it's there, but when I check out the branch locally, it's not -- so I gather you removed it along the way</p>



<a name="163579353"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163579353" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163579353">(Apr 17 2019 at 16:51)</a>:</h4>
<p>I'm not sure yodal is on Zulip</p>



<a name="163579378"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163579378" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163579378">(Apr 17 2019 at 16:51)</a>:</h4>
<p>Is that just a renaming thing, or is it a deeper change in strategy?</p>



<a name="163579393"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163579393" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163579393">(Apr 17 2019 at 16:51)</a>:</h4>
<p>yeah, <code>LazyConst</code> has since been removed</p>



<a name="163579480"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163579480" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163579480">(Apr 17 2019 at 16:52)</a>:</h4>
<p>Also, just a side observation:</p>
<p>If we had had the design meetings already, this would have been an awesome PR to go through such meetings. Reviewing this sort of thing would be <em>so much easier</em> if I had a clearer idea of what to expect when going into it.</p>
<p>It's probably a good 'case study' to think about what improvements we could make.</p>



<a name="163579483"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163579483" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163579483">(Apr 17 2019 at 16:52)</a>:</h4>
<p>previously, <code>Const</code> was split into <code>LazyConst::Unevaluated</code> and <code>LazyConst::Evaluated</code> (with all the various <code>Const</code> variants inside <code>Evaluated</code>)</p>



<a name="163579513"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163579513" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163579513">(Apr 17 2019 at 16:52)</a>:</h4>
<p>ok</p>



<a name="163579556"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163579556" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163579556">(Apr 17 2019 at 16:53)</a>:</h4>
<blockquote>
<p>this would have been an awesome PR to go through such meetings</p>
</blockquote>
<p>ah, that's true</p>



<a name="163579673"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163579673" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163579673">(Apr 17 2019 at 16:54)</a>:</h4>
<blockquote>
<p>previously, <code>Const</code> was split into <code>LazyConst::Unevaluated</code> and <code>LazyConst::Evaluated</code> (with all the various <code>Const</code> variants inside <code>Evaluated</code>)</p>
</blockquote>
<p>and now? :)</p>



<a name="163579675"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163579675" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163579675">(Apr 17 2019 at 16:54)</a>:</h4>
<p>(so, to clarify, the <code>LazyConst</code> discussion/changes are essentially just irrelevant aesthetic changes — it was just making the PR harder to read before it got refactored)</p>



<a name="163579692"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163579692" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163579692">(Apr 17 2019 at 16:55)</a>:</h4>
<p>ok</p>



<a name="163579695"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163579695" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163579695">(Apr 17 2019 at 16:55)</a>:</h4>
<p>now all the variants are in a single <code>ConstValue</code> enum</p>



<a name="163579698"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163579698" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163579698">(Apr 17 2019 at 16:55)</a>:</h4>
<p>which is how it was before <code>LazyConst</code></p>



<a name="163579712"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163579712" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163579712">(Apr 17 2019 at 16:55)</a>:</h4>
<p><code>LazyConst</code> wasn't actually around for very long</p>



<a name="163579815"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163579815" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163579815">(Apr 17 2019 at 16:56)</a>:</h4>
<p>ok, ok</p>



<a name="163579848"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163579848" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163579848">(Apr 17 2019 at 16:57)</a>:</h4>
<p>One thing I am wondering about is what the "normalization strategy" is</p>



<a name="163579875"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163579875" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163579875">(Apr 17 2019 at 16:57)</a>:</h4>
<p>i.e., is this meant to be "eager normalized" in the same way as associated types?</p>



<a name="163579997"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163579997" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163579997">(Apr 17 2019 at 16:59)</a>:</h4>
<p>I didn't make any deliberate decisions when it came to normalisation <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span><br>
if I didn't know what should be done, I generally tried to follow a similar strategy to the analogous methods for type variables</p>



<a name="163580019"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163580019" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163580019">(Apr 17 2019 at 16:59)</a>:</h4>
<p>so it's possible that there are some confusing "design" choices with regards to normalisation</p>



<a name="163580144"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163580144" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163580144">(Apr 17 2019 at 17:01)</a>:</h4>
<p>(that is to say, I don't feel I have such a good overview of the situation when it comes to normalisation in general)</p>



<a name="163580252"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163580252" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163580252">(Apr 17 2019 at 17:02)</a>:</h4>
<p>ok</p>



<a name="163580264"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163580264" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163580264">(Apr 17 2019 at 17:02)</a>:</h4>
<p>but the <code>Unevaluated</code> constant is meant to be a kind of "unnormalized" constant reference, right?</p>



<a name="163580281"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163580281" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163580281">(Apr 17 2019 at 17:03)</a>:</h4>
<div class="codehilite"><pre><span></span><span class="k">pub</span><span class="w"> </span><span class="k">enum</span> <span class="nc">ConstValue</span><span class="o">&lt;</span><span class="na">&#39;tcx</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="p">...</span><span class="w"></span>
<span class="w">    </span><span class="sd">/// Used in the HIR by using `Unevaluated` everywhere and later normalizing to one of the other</span>
<span class="w">    </span><span class="sd">/// variants when the code is monomorphic enough for that.</span>
<span class="w">    </span><span class="n">Unevaluated</span><span class="p">(</span><span class="n">DefId</span><span class="p">,</span><span class="w"> </span><span class="n">SubstsRef</span><span class="o">&lt;</span><span class="na">&#39;tcx</span><span class="o">&gt;</span><span class="p">),</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</pre></div>



<a name="163580284"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163580284" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163580284">(Apr 17 2019 at 17:03)</a>:</h4>
<p>i.e., that <span aria-label="point up" class="emoji emoji-1f446" role="img" title="point up">:point_up:</span></p>



<a name="163580301"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163580301" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163580301">(Apr 17 2019 at 17:03)</a>:</h4>
<p>ah, I think the general principle is to leave it <code>Unevaluated</code> as long as possible</p>



<a name="163580604"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163580604" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163580604">(Apr 17 2019 at 17:07)</a>:</h4>
<blockquote>
<p>(so, to clarify, the <code>LazyConst</code> discussion/changes are essentially just irrelevant aesthetic changes — it was just making the PR harder to read before it got refactored)</p>
</blockquote>
<p>just to double check something -- the changes around <code>LazyConst</code> occurred on master, and this PR was rebased over them?</p>



<a name="163580629"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163580629" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163580629">(Apr 17 2019 at 17:08)</a>:</h4>
<p>yep</p>



<a name="163580680"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163580680" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163580680">(Apr 17 2019 at 17:08)</a>:</h4>
<p>Also, to double check that I am understanding things -- what exactly is this PR <em>doing</em>. I <em>think</em> it is extending inference to include inference variables representing unknown constant values, and permitting unification with those?</p>



<a name="163580708"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163580708" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163580708">(Apr 17 2019 at 17:08)</a>:</h4>
<p>yes, that's the intention</p>



<a name="163580729"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163580729" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163580729">(Apr 17 2019 at 17:09)</a>:</h4>
<p>i.e., it is <em>not</em> really trying to define what const values <em>are</em> exactly? In other words, the <code>ConstVal</code> enum already exists, and we have operations on it etc that already happen.</p>
<p>(Except that it seems to be doing a fair amount of work on the folders etc...)</p>



<a name="163580757"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163580757" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163580757">(Apr 17 2019 at 17:09)</a>:</h4>
<p>it extends <code>ConstValue</code> a bit</p>



<a name="163580795"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163580795" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163580795">(Apr 17 2019 at 17:10)</a>:</h4>
<p>I think the <code>ConstValue::Infer</code> variant is already added on master, but it doesn't do very much</p>



<a name="163580886"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163580886" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163580886">(Apr 17 2019 at 17:10)</a>:</h4>
<p>so this PR also includes the handling of that variant</p>



<a name="163580909"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163580909" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163580909">(Apr 17 2019 at 17:11)</a>:</h4>
<p>(essentially the equivalent of <code>TyKind::Infer</code>)</p>



<a name="163580969"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163580969" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163580969">(Apr 17 2019 at 17:11)</a>:</h4>
<p>OK, I see</p>



<a name="163581003"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163581003" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163581003">(Apr 17 2019 at 17:12)</a>:</h4>
<p>I probably won't finish with this review today</p>



<a name="163581026"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163581026" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163581026">(Apr 17 2019 at 17:12)</a>:</h4>
<p>but I will schedule another 1.5-2hour block</p>



<a name="163581041"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163581041" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163581041">(Apr 17 2019 at 17:12)</a>:</h4>
<p>and I think I'll be able to move much faster now that i've kind of figured out what this PR is even about :P</p>



<a name="163581064"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163581064" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163581064">(Apr 17 2019 at 17:12)</a>:</h4>
<p>(so far it all seems to make sense, though)</p>



<a name="163581076"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163581076" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163581076">(Apr 17 2019 at 17:12)</a>:</h4>
<p>the folder changes are due to constants previously not turning up as inference variables, so that case now needs to be considered</p>



<a name="163581084"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163581084" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163581084">(Apr 17 2019 at 17:12)</a>:</h4>
<p>I haven't really gotten to trying to answer <span class="user-mention" data-user-id="119009">@eddyb</span>'s questions yet</p>



<a name="163581129"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163581129" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163581129">(Apr 17 2019 at 17:13)</a>:</h4>
<p>okay, great :)</p>



<a name="163581147"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163581147" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163581147">(Apr 17 2019 at 17:13)</a>:</h4>
<p>yeah, I appreciate that it's a large one to get through</p>



<a name="163581392"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163581392" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163581392">(Apr 17 2019 at 17:16)</a>:</h4>
<p>on a semi-related note, I want to do a call where I talk through how the Lark inference code and type-checker was setup</p>



<a name="163581394"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163581394" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163581394">(Apr 17 2019 at 17:16)</a>:</h4>
<p>in part to help <em>me</em> remember :P</p>



<a name="163581415"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163581415" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163581415">(Apr 17 2019 at 17:16)</a>:</h4>
<p>but in part because I rejiggered some of the bits here to try and address some of the boilerplate and other things I saw arising in rustc</p>



<a name="163581431"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163581431" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163581431">(Apr 17 2019 at 17:16)</a>:</h4>
<p>not sure if where I ended up was better or not really :) but it's worth thinking about</p>



<a name="163581577"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163581577" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163581577">(Apr 17 2019 at 17:18)</a>:</h4>
<p>there are definitely some places I saw that could use some refactoring as I was going through, but doing it in a more principled fashion would probably be wiser <span aria-label="+1" class="emoji emoji-1f44d" role="img" title="+1">:+1:</span></p>



<a name="163581594"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163581594" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163581594">(Apr 17 2019 at 17:18)</a>:</h4>
<p>yes, confirm</p>



<a name="163581600"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163581600" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163581600">(Apr 17 2019 at 17:18)</a>:</h4>
<p><span class="user-mention" data-user-id="121053">@varkor</span> -- one other question. I don't <em>think</em> I saw any tests yet in this PR</p>



<a name="163581617"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163581617" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163581617">(Apr 17 2019 at 17:19)</a>:</h4>
<p>maybe I missed them</p>



<a name="163581633"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163581633" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163581633">(Apr 17 2019 at 17:19)</a>:</h4>
<p>is there a reason that we can't write tests for this code?</p>



<a name="163581645"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163581645" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163581645">(Apr 17 2019 at 17:19)</a>:</h4>
<p>ah, that's true — most of the tests are still in the main const generics PR</p>



<a name="163581652"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163581652" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163581652">(Apr 17 2019 at 17:19)</a>:</h4>
<p>but I think with these changes, most of them should work now</p>



<a name="163581661"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163581661" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163581661">(Apr 17 2019 at 17:19)</a>:</h4>
<p>I would prefer to land the code together with tests</p>



<a name="163581665"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163581665" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163581665">(Apr 17 2019 at 17:19)</a>:</h4>
<p>I'll try moving them over</p>



<a name="163581675"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163581675" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163581675">(Apr 17 2019 at 17:19)</a>:</h4>
<p>I would also like to kind of walk through some of the representative tests</p>



<a name="163581678"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163581678" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163581678">(Apr 17 2019 at 17:19)</a>:</h4>
<p>i.e., I've sort of seen the "trees" now</p>



<a name="163581684"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163581684" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163581684">(Apr 17 2019 at 17:19)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> heh, so, <code>LazyConst</code> was an accidental thing in part caused by me not being around: <code>ty::Const</code> is supposed to be a third kind, alongside <code>Ty</code> and <code>ty::Region</code>, but not everyone was aware of that</p>



<a name="163581687"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163581687" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163581687">(Apr 17 2019 at 17:19)</a>:</h4>
<p>I was hoping (in the next review session) to try and see the forest</p>



<a name="163581772"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163581772" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163581772">(Apr 17 2019 at 17:20)</a>:</h4>
<p>now it's back to what it should be, and <code>ConstValue</code> is just the enum with the variants of <code>ty::Const</code> (which has to be a struct because of the <code>ty: Ty</code> field)</p>



<a name="163581773"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163581773" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163581773">(Apr 17 2019 at 17:20)</a>:</h4>
<p>so if you have a sample test or two that would be good to walk through</p>



<a name="163581788"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163581788" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163581788">(Apr 17 2019 at 17:20)</a>:</h4>
<p>I'd appreciate it</p>



<a name="163581848"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163581848" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163581848">(Apr 17 2019 at 17:21)</a>:</h4>
<p>I am close to wanting to just unify all the kinds :P</p>



<a name="163581850"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163581850" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163581850">(Apr 17 2019 at 17:21)</a>:</h4>
<p>I'll check the tests tonight and also try to add a few more</p>



<a name="163581869"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163581869" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163581869">(Apr 17 2019 at 17:21)</a>:</h4>
<p>and rename <code>Kind</code> to <code>Term</code></p>



<a name="163581876"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163581876" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163581876">(Apr 17 2019 at 17:21)</a>:</h4>
<p>they've been added on quite an ad hoc basis at the moment</p>



<a name="163581890"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163581890" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163581890">(Apr 17 2019 at 17:21)</a>:</h4>
<p><span class="user-mention" data-user-id="119009">@eddyb</span>: that doesn't sound like an enviable task</p>



<a name="163581960"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163581960" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163581960">(Apr 17 2019 at 17:22)</a>:</h4>
<p>it's tempting, but not necessarily enticing</p>



<a name="163581963"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163581963" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163581963">(Apr 17 2019 at 17:22)</a>:</h4>
<p><span class="user-mention" data-user-id="119009">@eddyb</span>  what is your next step after that? cumulative universes? :P</p>



<a name="163581968"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163581968" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163581968">(Apr 17 2019 at 17:22)</a>:</h4>
<p>or is it the other way around? :P</p>



<a name="163581986"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163581986" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163581986">(Apr 17 2019 at 17:22)</a>:</h4>
<p><span class="user-mention" data-user-id="126931">@centril</span> how would you have those with no dependent typing :P</p>



<a name="163581990"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163581990" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163581990">(Apr 17 2019 at 17:22)</a>:</h4>
<p>Type0, Type1, ... here we go</p>



<a name="163582049"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163582049" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163582049">(Apr 17 2019 at 17:23)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> <span class="user-mention" data-user-id="121053">@varkor</span> Yay for tests! They will definitely be more important as the feature nears completion, especially for a feature this big</p>



<a name="163582055"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163582055" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163582055">(Apr 17 2019 at 17:23)</a>:</h4>
<p><span class="user-mention" data-user-id="126931">@centril</span>: if you like writing tests... :)</p>



<a name="163582138"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163582138" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163582138">(Apr 17 2019 at 17:24)</a>:</h4>
<p><span class="user-mention" data-user-id="121053">@varkor</span> apparently <span class="user-mention" data-user-id="124069">@Alexander Regueiro</span> assigned me as Mr. Test :P</p>



<a name="163582146"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163582146" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163582146">(Apr 17 2019 at 17:24)</a>:</h4>
<p>:-D</p>



<a name="163582155"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163582155" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163582155">(Apr 17 2019 at 17:24)</a>:</h4>
<p>Either one of you is fine!</p>



<a name="163582181"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163582181" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163582181">(Apr 17 2019 at 17:24)</a>:</h4>
<p>oh, this is consnt generics. I thought you were talking about upcasting again</p>



<a name="163582345"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163582345" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> yodal <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163582345">(Apr 17 2019 at 17:26)</a>:</h4>
<p>hello, folks. I'm a tad late to  the party</p>



<a name="163582492"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163582492" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> yodal <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163582492">(Apr 17 2019 at 17:28)</a>:</h4>
<p>re: tests, we have not included tests up until this point because most uses of const generics would crash the compiler. With theses changes, we might have enough for some to pass, though I don't know how much we have outside of this PR left to merge in from our massive PR</p>



<a name="163582563"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163582563" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> yodal <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163582563">(Apr 17 2019 at 17:29)</a>:</h4>
<p>also, we definitely need more tests, specifically more tests that target a specific aspect of the feature</p>



<a name="163582576"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/const%20generics%20in%20%60infer%60%20%2359008/near/163582576" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> varkor <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/const.20generics.20in.20.60infer.60.20.2359008.html#163582576">(Apr 17 2019 at 17:29)</a>:</h4>
<p>yeah, I was planning to compare master with the main PR once the infer changes had landed; I'm not sure how many changes remain after that either</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>